package com.goldman.http.common.s2s;


import com.goldman.http.common.s2s.model.ResponseData;
import lombok.Builder;
import lombok.Data;

import java.util.Objects;

@Data
@Builder
public class S2SResponse<D> {

    private static final int HTTP_200 = 200;
    private ResponseData<D> responseData;
    private int httpStatus;
    private Exception exception;
    private String exceptionPoint;
    private String responseRawContent;
    private long executeTime;

    public boolean isHTTPSuccess() {
        return HTTP_200 == httpStatus && Objects.isNull(exception) && Objects.nonNull(responseData);
    }

}
